package com.captjack.jersey.controller;

import com.captjack.jersey.entity.User;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

/**
 * Description description.....
 *
 * @author Jack Sparrow
 * @version 1.0.0
 * @date 19/08/2018 00:13
 * package com.captjack.jersey.controller
 */
@Component
@Path("/users")
@Produces(value = {MediaType.APPLICATION_JSON + ";charset=utf-8"})
public class UserController {

    @Path("/{age}")
    @GET
    public User get(@PathParam("age") Integer id, @QueryParam("name") String name) {
        User user = new User();
        user.setAge(id);
        user.setName(name);
        return user;
    }

}
